package com.zjuee.base.dto.common.ledger;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.zjuee.base.base.Converter;
import com.zjuee.base.bean.Pages;
import com.zjuee.base.model.common.ledger.LedgerDispose;
import lombok.*;
import org.springframework.beans.BeanUtils;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class LedgerDisposeDto extends LedgerDispose implements Converter<LedgerDispose, LedgerDisposeDto> {

	@JsonInclude(JsonInclude.Include.NON_NULL)
	private Pages page;

	@Override
	public void convertToDo(LedgerDispose ledgerDispose) {
		BeanUtils.copyProperties(this, ledgerDispose);
	}

	@Override
	public LedgerDisposeDto convert(LedgerDispose ledgerDispose) {
		BeanUtils.copyProperties(ledgerDispose, this);
		return this;
	}

}
